<template>
  <div class="empty-data">
    <img :src="icon"
         class="empty-icon" />
    <div class="empty-desc">{{emptyDesc}}</div>
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: 'EmptyData',
  props: {
    icon: {
      type: String,
      default: require('@/assets/image/list-empty.png')
    },
    emptyDesc: {
      type: String,
      default: '暂无相关数据'
    }
  }
}
</script>

<style lang="scss" scoped>
.empty-data {
  background-color: #f5f6fa;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  color: #999999;
  text-align: center;

  .empty-icon {
    width: 130px;
  }
  .empty-desc {
    margin: 10px auto;
    width: 185px;
  }
}
</style>
